package com.dorm.cj.medium;

import java.util.HashSet;
import java.util.Set;

public class ChartRoom {

    Set<User> users = new HashSet<>();

    public void register(User user) {
        users.add(user);
    }

    public void sendMsg(User from, String msg) {
        for (User user : users) {
            if (user.name != from.name) {
                user.receiveMsg(from, msg);
            }
        }
    }

}
